<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>报名勤工管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
	<script type="text/javascript"> //去除重复下列框
    $(function () {
        $("select").each(function (i, n) {
            var options = "";
            $(n).find("option").each(function (j, m) {
                if (options.indexOf($(m)[0].outerHTML) == -1) {
                    options += $(m)[0].outerHTML;
                }
            });
            $(n).html(options);
        });
    });
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/jobmesmanage/stuJob/">报名勤工列表</a></li>
		<shiro:hasPermission name="jobmesmanage:stuJob:edit"><li><a href="${ctx}/jobmesmanage/stuJob/form">报名勤工添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="stuJob" action="${ctx}/jobmesmanage/stuJob/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>学生姓名</label>
				<form:select path="stuId" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${stuJobs}" itemLabel="username" itemValue="stuId" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>需求方名称：</label>
				<form:select path="jobId" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${stuJobs}" itemLabel="reqName" itemValue="stuId" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>学生姓名</th>
				<th>需求方名称</th>

				<shiro:hasPermission name="jobmesmanage:stuJob:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="stuJob">
			<tr>
				<td><a href="${ctx}/jobmesmanage/stuJob/form?id=${stuJob.id}">
					${stuJob.username}
				</a></td>
				<td>
					${stuJob.reqName}
				</td>
				<shiro:hasPermission name="jobmesmanage:stuJob:edit"><td>
    				<a href="${ctx}/jobmesmanage/stuJob/form?id=${stuJob.id}">修改</a>
					<a href="${ctx}/jobmesmanage/stuJob/delete?id=${stuJob.id}" onclick="return confirmx('确认要删除该报名勤工吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>